package com.bosssoft.cloud.wechat.core.infra.config;

import com.bosssoft.cloud.wechat.core.infra.properties.AreaProperties;
import com.bosssoft.cloud.wechat.core.infra.properties.WxConfigProperties;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 微信配置信息类
 * <p>
 *
 * @author wcy create on 2021/6/24 12:45 下午
 */
@Component
public class WxConfig {
    @Resource
    private AreaProperties areaProperties;
    @Resource
    private WxConfigProperties wxConfigProperties;

    /**
     * 获取微信mp配置信息
     *
     * @return 微信配置properties类
     */
    public WxConfigProperties getMpConfig() {
        return wxConfigProperties;
    }

    /**
     * 获取当前公众号区划名称
     *
     * @return 区划名称 eg:北京市
     */
    public String getAreaName() {
        return areaProperties.getArea().get(wxConfigProperties.getArea());
    }

}
